﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace ESOL.WebServices
{
    public class WebCommonFunctions
    {
        public static string EmployeePhotoPath()
        {
            string path = ConfigurationManager.AppSettings["EmployeePhotoPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string SupplierAttachedPath(string supplierCode)
        {
            string path = ConfigurationManager.AppSettings["SupplierAttachedPath"];
            path += "\\" + supplierCode;
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string PurchaseOrderAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["PurchaseOrderAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string PurchaseQuoteAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["PurchaseQuoteAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string UpdateFileFolder()
        {
            return ConfigurationManager.AppSettings["UpdateFileFolder"];
        }
        public static string SalesOrderAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["SalesOrderAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string SalesQuoteAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["SalesQuoteAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string EmployeefilePath()
        {
            string path = ConfigurationManager.AppSettings["EmployeefilePath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }//+
        public static string PersonLeave()
        {
            string path = ConfigurationManager.AppSettings["PersonLeave"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }//+
        public static string ProductRegisterAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["ProductRegisterAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string RepairReportAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["RepairReportAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string PictureFilePath()
        {
            return ConfigurationManager.AppSettings["PictureFileStrength"];
        }
        public static string SignaturePicPath()
        {
            string path=ConfigurationManager.AppSettings["SignaturePicPath"];
            if(Directory.Exists(path)==false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
        public static string BptAttachedPath()
        {
            string path = ConfigurationManager.AppSettings["BptAppAttachedPath"];
            if (Directory.Exists(path) == false)
            {
                Directory.CreateDirectory(path);
            }
            return path;
        }
    }
}